package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpTimeClockTimecardSummaryPageUtil extends SeleniumPageUtil {
	public final static By TCTS_SPAN_HEADER = By.id("ctl44_lblHdr");
	public final static By TCTS_SELECT_PAY_PERIOD = By.id("ctl44_cboPeriod");
	public final static By TCTS_STRONG_SHOW_DIRECT_REPORTS = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/strong");
	public final static By TCTS_INPUT_DIRECT_REPORTS = By.id("ctl44_chkDirectReports");
	public final static By TCTS_TH_EMPLOYEE = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[1]");
	public final static By TCTS_TH_WEEK_1 = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[1]/th[2]");
	// the day of week 1
	public final static By TCTS_TH_WEEK_1_MON = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[2]");
	public final static By TCTS_TH_WEEK_1_TUE = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[3]");
	public final static By TCTS_TH_WEEK_1_WED = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[4]");
	public final static By TCTS_TH_WEEK_1_THUR = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[5]");
	public final static By TCTS_TH_WEEK_1_FRI = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[6]");
	public final static By TCTS_TH_WEEK_1_SAT = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[7]");
	public final static By TCTS_TH_WEEK_1_SUN = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[8]");
	public final static By TCTS_TH_WEEK_1_TOT = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[9]");
	
	public final static By TCTS_TH_WEEK_2 = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[1]/th[3]");
	// the day of week 2
	public final static By TCTS_TH_WEEK_2_MON = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[10]");
	public final static By TCTS_TH_WEEK_2_TUE = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[11]");
	public final static By TCTS_TH_WEEK_2_WED = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[12]");
	public final static By TCTS_TH_WEEK_2_THUR = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[13]");
	public final static By TCTS_TH_WEEK_2_FRI = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[14]");
	public final static By TCTS_TH_WEEK_2_SAT = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[15]");
	public final static By TCTS_TH_WEEK_2_SUN = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[16]");
	public final static By TCTS_TH_WEEK_2_TOT = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[2]/th[17]");
	
	public final static By TCTS_TH_TOTALS = By.xpath("//*[@id='ctl44_lblTimeCardOut']/table/tbody/tr[1]/th[4]");
	
	
	public static void enterTimeClockTimecardSummaryPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.enterTimeClockTimecardSummaryPage();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				TCTS_SELECT_PAY_PERIOD
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(TCTS_SELECT_PAY_PERIOD));
	}
}
